package com.go.where.manager.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.go.where.manager.dao.ActivitySignupDao;
import com.go.where.manager.page.Pagination;
import com.go.where.manager.pojo.ActivitySignupInfo;
import com.go.where.manager.service.ActivitySignupService;

@Service("activitySignupService")
public class ActivitySignupServiceImpl implements ActivitySignupService {

	@Resource(name = "activitySignupDao")
	private ActivitySignupDao activitySignupDao;

	@Override
	public ActivitySignupInfo queryByPrimartKey(String cid) {
		return activitySignupDao.getByKey(cid);
	}

	@Override
	public Pagination<ActivitySignupInfo> queryPage(
			ActivitySignupInfo signupInfo) {
		Integer count = activitySignupDao.totalCount(signupInfo);
		signupInfo.calculate();
		List<ActivitySignupInfo> list = activitySignupDao
				.queryList(signupInfo);
		Pagination<ActivitySignupInfo> page = activitySignupDao
				.queryPagination(count, list, signupInfo);
		return page;
	}

	@Override
	public int update(ActivitySignupInfo activitySignupInfo) {
		return activitySignupDao.update(activitySignupInfo);
	}

}
